﻿using System;
using System.Data;

namespace AlertSystem.Dab.LK
{
    public class LkOrdersAlertItem : IAlertItem
    {
        public string Id { get; private set; }
        public string UserName { get; private set; }
        public string UserId { get; private set; }
        public DateTime DateCreate { get; private set; }
        public DateTime DateEdit { get; private set; }
        public string Value { get; private set; }
        public object Data { get; private set; }
        public string Comment { get; private set; }
        public string SysAlertName { get { return "ЛК: Поручения"; } }
        

        public LkOrdersAlertItem()
        {

        }

        public LkOrdersAlertItem(DataRow r)
        {
            Id = r["Id"].ToString();
            UserId = r["UserId"].ToString();
            UserName = r["UserName"].ToString();
            DateCreate = DateTime.Parse(r["DateCreate"].ToString());
            DateEdit = DateTime.Parse(r["DateEdit"].ToString());
            Comment = r["Comment"].ToString();
            Value = r["Value"].ToString();
            Data = r["Data"];
        }

        public override string ToString()
        {
            return string.Format("{0} / {1} / {2}", Id, DateCreate, Value);
        }
    }
}